package com.yuntian.controller.user;

import com.yuntian.Dto.ProductPageQueryDto;
import com.yuntian.result.PageResult;
import com.yuntian.result.Result;
import com.yuntian.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("userProductController")
@RequestMapping("/user/product")
public class ProductController {
    @Autowired
    private ProductService productService;
    /**
     * 商品列表
     */
    @GetMapping("/list")
    public Result<PageResult> list(
            ProductPageQueryDto productPageQueryDto) {

        PageResult pageResult = productService.list(productPageQueryDto);
        return Result.success(pageResult);
    }
}
